package com.corpgovernment.organization.enumm;

import java.util.Arrays;

public enum UserRoleEnum {
    E("0", "员工"),
    L("1", "领导"),
    S("2", "秘书"),
    F("3", "财务"),
    C("4", "结算");

    private String code;
    private String desc;

    UserRoleEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static UserRoleEnum getByCode(String code) {
        return Arrays.stream(UserRoleEnum.values()).filter(e -> code.equals(e.code)).findFirst().orElse(null);
    }
}
